package com.xiaozhaovip.demo.Enum;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;


/**
 * 活动参与人的状态
 *
 * @author Cauli
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum YueQiLaiActivityJoinerStatusEnum {
    NotSignUpAndActivityEnd(0,"未报名"),
    WaitingToStart(1,"等待活动开始"),
    SignedUpAndCancelled(2,"取消报名");

    private int id;
    private String name;

    /**
     * 通过 id 得到活动状态
     *
     * @param id
     * @return
     */
    public static YueQiLaiActivityJoinerStatusEnum getById(int id) {
        for (YueQiLaiActivityJoinerStatusEnum activityJoinerStatusEnum : YueQiLaiActivityJoinerStatusEnum.values()) {
            if (id == activityJoinerStatusEnum.id) {
                return activityJoinerStatusEnum;
            }
        }
        return null;
    }
}
